package ch1;

import java.util.Scanner;

public class Zuoye03101 {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入矩形的长和宽：");
        int a=0;
        int b=0;
        while (true){
            a=scan.nextInt();
            b=scan.nextInt();
            if (a>=3&&b>=3){
                break;
            }
            System.out.println("输入错误，请重新输入");
        }
        for (int i=1;i<=b;i++){
            for (int c=1;c<=a;c++){
                if (c==1||c==a) {
                    System.out.print("*");
                }
                else if (i==1||i==b){
                    System.out.print("*");
                }
                System.out.print("\t");
            }
            System.out.println();
        }
    }
}
